package com.umakr.ax.common.service;

import com.umakr.ax.common.mapper.WechatOpenAccountMapper;
import com.umakr.ax.common.model.WechatOpenAccount;
import com.umakr.ax.core.base.BaseService;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;


/**
 * <p>
 * 第三方平台帐号信息 服务实现类
 * </p>
 *
 * @author Wmdz
 * @since 2018-01-09
 */
@Service
public class WechatOpenAccountService extends BaseService<WechatOpenAccountMapper, WechatOpenAccount>{

    public WechatOpenAccount load() {
        List<WechatOpenAccount> list = this.queryList(new HashMap<>(16));
        if (list != null && list.isEmpty()) {
            return list.get(0);
        }
        return null;
    }


    public Boolean save(WechatOpenAccount wechatOpenAccount) {
        return this.insertOrUpdate(wechatOpenAccount);
    }

}
